package com.conghuhu;

import java.util.HashMap;
import java.util.Map;

/**
 * @author conghuhu
 * @create 2021-09-24 20:00
 */
public class Result {

    private Boolean success;

    private String status;

    private String message;

    Object data = new Object();

    public Result(){};

    public static Result success(Object data){
        Result result = new Result();
        result.success = true;
        result.status = "200";
        result.data = data;
        return result;
    }

    public static Result fail(String status,String message){
        Result result = new Result();
        result.status = status;
        result.success = false;
        result.message = message;
        result.data = null;
        return result;
    }

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}

